{% extends "admin.html" %}

{% block title %}The Living History: Groups{% endblock %}

{% block display %}

		<h2>Groups:</h2>
		<table>
			<tr><th>Name</th><th>Permissions</th></tr>
		{% for group in groups %}
			<tr>
				<td>{{ group.name }}</td>
				<td>{% for perm in group.permissions %}{{ perm }}, {% endfor %}</td>
				<td><a href="/admin/editGroup/{{group.name}}">Edit</a></td>
			</tr>
		{% endfor %}
		</table>
		
		<p>
		<h2>Add group:</h2>
		<form action="/admin/addGroup" method="post">
		<table>
	      <tr>
		    <td>Name:</td>
			<td><input type="Text" name="name" size="25"></td>
		  </tr>
		  <tr>
			  <td>Permissions:</td>
			  <td>
			  <input type="Checkbox" name="permissions" value="timeline_edit">timeline_edit <br />
			  <input type="Checkbox" name="permissions" value="timeline_create">timeline_create <br />
			  <input type="Checkbox" name="permissions" value="timeline_delete">timeline_delete <br />
			  <input type="Checkbox" name="permissions" value="admin_access">admin_access <br />
			  <input type="Checkbox" name="permissions" value="user_edit">user_edit <br />
			  <input type="Checkbox" name="permissions" value="group_edit">group_edit <br />
			  </td>
		  </tr>
		  <tr>
		  <td align="center" colspan="2"><input type="Submit" name="add" value="Add group"></td>
		  </tr>
		</table>
		</form>
		</p>

{% endblock %}